home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
KOSCHEKA
/
GETFILEM.C
< prev
next >
Wrap
Text File
|
1990-06-07
|
1KB
|
50 lines
/********************************/
/* File: FIleOpen.c */
/* */
/* open the file whose name and */
/* working directory id are */
/* passed as parameters. This */
/* information can be obtained */
/* using GetFileNameToLoad... */
/* */
/* Paramters: */
/* param0 = file reference num */
/* */
/* Out: */
/* File RefNum if opened, 0 */
/* otherwise */
/* ---------------------------- */
/********************************/
#include <MacTypes.h>
#include <OSUtil.h>
#include <MemoryMgr.h>
#include <FileMgr.h>
#include <ResourceMgr.h>
#include <pascal.h>
#include <string.h>
#include "HyperXCmd.h"
#include "HyperUtils.h"
pascal void main( paramPtr )
XCmdBlockPtr paramPtr;
{
Str31 str;
short refnum;
long fpos = 0;
HLock( paramPtr->params[0] );
ZeroToPas( paramPtr, *(paramPtr->params[0]), &str );
HUnlock( paramPtr->params[0] );
refnum = (short)StrToNum( paramPtr, &str );
/*** Get the file position and return ***/
GetFPos( refnum, &fpos );
NumToStr( paramPtr, fpos, &str );
paramPtr->returnValue = PasToZero( paramPtr, &str );
}